/**
 * 庆云县地图数据 - GeoJSON格式
 * 包含庆云县的行政区域边界坐标信息
 * 数据来源：行政区划数据
 * 坐标系：WGS84
 */

// GeoJSON 类型定义
export interface GeoJSONFeature {
  type: 'Feature';
  properties: {
    adcode: number;        // 行政区划代码
    name: string;          // 区域名称
    center: [number, number];    // 中心点坐标 [经度, 纬度]
    centroid: [number, number];  // 质心坐标 [经度, 纬度]
    childrenNum: number;   // 子区域数量
    level: string;         // 行政级别
    acroutes: number[];    // 行政区划路径
    parent: {
      adcode: number;      // 父级行政区划代码
    };
  };
  geometry: {
    type: 'MultiPolygon';
    coordinates: number[][][][]; // 多边形坐标数组
  };
}

export interface GeoJSONFeatureCollection {
  type: 'FeatureCollection';
  features: GeoJSONFeature[];
}

// 庆云县地图数据
export const qingyunMapData: GeoJSONFeatureCollection = {
  type: 'FeatureCollection',
  features: [
    {
      type: 'Feature',
      properties: {
        adcode: 371423,
        name: '庆云县',
        center: [117.420507, 37.827724],
        centroid: [117.45604, 37.795352],
        childrenNum: 0,
        level: 'district',
        acroutes: [100000, 370000, 371400],
        parent: {
          adcode: 371400
        }
      },
      geometry: {
        type: 'MultiPolygon',
        coordinates: [[
          [
            [117.556636, 37.713736], [117.555336, 37.715102], [117.556167, 37.716675],
            [117.549812, 37.718491], [117.548758, 37.719377], [117.548159, 37.721164],
            [117.549966, 37.722468], [117.549275, 37.723768], [117.54834, 37.724305],
            [117.54658, 37.723851], [117.547106, 37.724708], [117.546284, 37.725899],
            [117.542637, 37.726252], [117.54202, 37.727236], [117.542415, 37.731074],
            [117.545118, 37.732843], [117.545106, 37.733449], [117.547183, 37.737487],
            [117.545592, 37.738391], [117.546892, 37.742879], [117.546272, 37.743424],
            [117.543079, 37.744171], [117.544106, 37.747704], [117.539427, 37.74708],
            [117.534768, 37.74839], [117.531558, 37.748198], [117.531199, 37.753277],
            [117.528024, 37.753571], [117.529143, 37.754809], [117.525051, 37.755154],
            [117.52444, 37.754391], [117.523223, 37.75446], [117.522203, 37.75539],
            [117.52171, 37.759488], [117.525416, 37.760385], [117.526306, 37.760947],
            [117.526478, 37.76298], [117.532077, 37.763103], [117.533484, 37.763343],
            [117.535454, 37.764033], [117.538106, 37.765978], [117.539231, 37.76772],
            [117.54553, 37.767633], [117.547337, 37.767506], [117.548622, 37.769963],
            [117.547933, 37.770784], [117.545127, 37.771865], [117.54348, 37.772834],
            [117.544183, 37.773556], [117.546058, 37.77278], [117.547767, 37.774816],
            [117.546574, 37.776358], [117.549206, 37.7788], [117.551298, 37.780506],
            [117.550177, 37.781754], [117.550862, 37.784755], [117.554055, 37.791882],
            [117.559915, 37.800027], [117.560294, 37.802059], [117.563113, 37.801932],
            [117.563911, 37.801718], [117.563864, 37.799472], [117.564107, 37.798997],
            [117.565395, 37.798507], [117.567908, 37.803086], [117.56857, 37.804968],
            [117.568552, 37.806837], [117.568124, 37.808513], [117.566389, 37.811719],
            [117.566246, 37.812735], [117.570044, 37.81543], [117.571943, 37.817048],
            [117.572866, 37.817331], [117.574409, 37.817258], [117.575919, 37.816972],
            [117.57713, 37.816943], [117.578471, 37.817146], [117.583283, 37.81963],
            [117.58801, 37.822713], [117.590096, 37.824773], [117.590737, 37.825803],
            [117.591731, 37.828661], [117.591787, 37.831613], [117.59211, 37.832135],
            [117.593223, 37.833274], [117.595327, 37.834757], [117.598386, 37.836012],
            [117.602068, 37.837252], [117.604376, 37.838369], [117.605038, 37.838978],
            [117.605554, 37.840142], [117.606076, 37.841955], [117.606557, 37.845222],
            [117.602314, 37.846654], [117.600935, 37.850453], [117.596988, 37.852969],
            [117.595704, 37.853488], [117.59138, 37.853818], [117.587556, 37.854699],
            [117.585758, 37.855768], [117.581082, 37.859009], [117.579577, 37.861068],
            [117.579723, 37.86296], [117.581978, 37.868898], [117.581945, 37.869815],
            [117.581011, 37.869822], [117.580637, 37.871011], [117.580592, 37.875302],
            [117.579364, 37.875258], [117.579417, 37.871978], [117.578767, 37.873747],
            [117.578376, 37.876715], [117.57456, 37.880242], [117.568842, 37.882394],
            [117.562214, 37.88296], [117.55644, 37.882597], [117.547221, 37.88321],
            [117.542771, 37.89016], [117.541171, 37.895675], [117.541338, 37.903004],
            [117.540602, 37.908283], [117.539287, 37.913572], [117.531217, 37.926531],
            [117.529048, 37.932293], [117.538685, 37.937164], [117.545349, 37.93866],
            [117.567783, 37.946763], [117.569905, 37.951083], [117.570626, 37.957252],
            [117.568774, 37.96438], [117.567813, 37.972408], [117.566774, 37.977237],
            [117.566626, 37.98319], [117.565353, 37.99054], [117.56352, 37.998587],
            [117.555336, 38.006731], [117.549358, 38.010273], [117.541074, 38.011243],
            [117.538967, 38.008685], [117.532914, 38.002042], [117.530036, 37.998464],
            [117.527998, 37.996271], [117.525496, 37.992519], [117.524363, 37.989472],
            [117.52371, 37.986078], [117.522701, 37.978648], [117.521633, 37.971916],
            [117.520879, 37.966711], [117.520452, 37.964811], [117.51934, 37.96148],
            [117.517007, 37.955456], [117.51515, 37.950243], [117.513753, 37.946597],
            [117.512809, 37.943454], [117.511693, 37.941488], [117.510848, 37.940369],
            [117.509702, 37.939203], [117.508041, 37.937964], [117.506551, 37.937146],
            [117.499499, 37.93217], [117.495149, 37.929226], [117.492731, 37.927484],
            [117.490072, 37.925068], [117.486349, 37.921055], [117.481159, 37.914847],
            [117.47675, 37.907294], [117.473109, 37.901559], [117.46949, 37.89512],
            [117.466822, 37.890758], [117.462897, 37.885891], [117.456031, 37.87644],
            [117.451453, 37.870402], [117.448981, 37.867285], [117.445438, 37.862612],
            [117.44267, 37.858639], [117.438572, 37.853872], [117.434715, 37.851748],
            [117.430953, 37.850181], [117.427312, 37.848764], [117.423595, 37.847263],
            [117.4148, 37.844757], [117.410035, 37.843811], [117.406299, 37.843499],
            [117.403131, 37.843938], [117.400772, 37.844815], [117.398576, 37.846016],
            [117.394351, 37.848546], [117.390325, 37.850693], [117.386714, 37.852378],
            [117.384212, 37.853694], [117.381934, 37.854525], [117.37737, 37.854757],
            [117.373041, 37.854336], [117.368122, 37.853974], [117.364683, 37.854148],
            [117.36136, 37.854851], [117.35887, 37.855794], [117.356823, 37.857001],
            [117.352791, 37.859538], [117.348521, 37.861365], [117.344249, 37.862659],
            [117.34146, 37.863065], [117.33873, 37.863062], [117.32452, 37.861764],
            [117.320132, 37.861402], [117.318726, 37.861064], [117.319545, 37.860071],
            [117.329754, 37.850316], [117.338065, 37.846327], [117.3444, 37.84442],
            [117.347429, 37.837284], [117.342955, 37.831845], [117.330915, 37.821556],
            [117.32585, 37.818158], [117.320242, 37.812633], [117.316753, 37.808175],
            [117.310353, 37.792314], [117.309851, 37.78993], [117.309866, 37.788725],
            [117.310676, 37.78772], [117.313548, 37.785528], [117.315269, 37.785173],
            [117.315242, 37.783449], [117.311308, 37.783482], [117.310626, 37.783162],
            [117.310578, 37.780027], [117.311281, 37.778891], [117.313026, 37.778583],
            [117.312806, 37.777882], [117.313741, 37.777679], [117.312572, 37.775389],
            [117.311578, 37.771005], [117.312468, 37.770903], [117.317856, 37.768203],
            [117.314228, 37.766283], [117.312189, 37.761169], [117.312682, 37.757234],
            [117.313296, 37.758177], [117.314492, 37.757981], [117.316121, 37.756068],
            [117.315963, 37.754493], [117.315447, 37.743968], [117.316646, 37.739854],
            [117.31672, 37.738631], [117.315595, 37.737414], [117.314726, 37.737182],
            [117.313332, 37.737512], [117.318396, 37.730915], [117.325316, 37.720891],
            [117.325639, 37.720227], [117.325049, 37.718926], [117.324977, 37.714869],
            [117.322844, 37.714466], [117.320782, 37.702501], [117.321055, 37.701447],
            [117.323672, 37.701785], [117.324161, 37.702083], [117.324013, 37.703791],
            [117.324586, 37.704662], [117.32868, 37.70488], [117.329938, 37.703235],
            [117.329244, 37.70164], [117.328197, 37.701019], [117.32523, 37.701011],
            [117.327034, 37.699715], [117.32863, 37.699326], [117.330455, 37.700808],
            [117.332463, 37.704092], [117.338003, 37.704993], [117.342596, 37.707528],
            [117.344946, 37.709381], [117.348601, 37.709388], [117.349533, 37.709098],
            [117.349548, 37.70779], [117.35158, 37.707416], [117.352562, 37.707358],
            [117.353447, 37.706878], [117.35347, 37.706166], [117.354254, 37.705763],
            [117.359428, 37.700971], [117.363446, 37.700129], [117.365719, 37.698363],
            [117.365805, 37.688067], [117.365247, 37.684495], [117.363906, 37.681432],
            [117.365811, 37.681141], [117.365597, 37.679393], [117.363633, 37.679578],
            [117.361226, 37.675515], [117.358158, 37.672939], [117.356868, 37.66599],
            [117.359615, 37.665092], [117.357782, 37.660451], [117.357568, 37.65851],
            [117.360387, 37.65727], [117.362102, 37.654915], [117.363852, 37.649614],
            [117.373083, 37.648597], [117.379207, 37.651498], [117.386829, 37.656903],
            [117.392959, 37.660036], [117.397383, 37.664565], [117.400754, 37.673451],
            [117.407216, 37.678866], [117.41172, 37.673542], [117.415376, 37.669595],
            [117.428846, 37.665743], [117.436964, 37.668371], [117.444246, 37.671929],
            [117.451963, 37.669973], [117.456173, 37.66487], [117.463517, 37.657303],
            [117.465662, 37.655569], [117.469309, 37.654617], [117.472056, 37.654446],
            [117.475447, 37.654006], [117.477079, 37.654413], [117.478281, 37.656249],
            [117.479785, 37.658866], [117.48102, 37.661825], [117.481545, 37.663486],
            [117.483396, 37.668243], [117.488589, 37.677042], [117.495009, 37.679262],
            [117.496716, 37.680214], [117.498816, 37.679963], [117.500665, 37.67992],
            [117.503433, 37.680556], [117.504519, 37.681788], [117.506798, 37.683964],
            [117.506451, 37.686809], [117.509946, 37.687322], [117.51015, 37.686947],
            [117.511483, 37.687703], [117.51358, 37.688731], [117.514275, 37.688855],
            [117.52487, 37.689066], [117.531232, 37.688895], [117.531876, 37.689905],
            [117.53214, 37.693898], [117.537738, 37.694654], [117.538421, 37.695006],
            [117.538086, 37.69582], [117.539907, 37.696336], [117.539359, 37.697357],
            [117.539623, 37.698323], [117.543064, 37.703634], [117.538676, 37.704829],
            [117.537712, 37.706559], [117.537792, 37.707561], [117.541667, 37.7099],
            [117.539442, 37.711063], [117.539267, 37.712857], [117.539774, 37.713983],
            [117.541308, 37.714822], [117.545764, 37.715625], [117.548011, 37.717208],
            [117.55158, 37.71423], [117.552969, 37.711884], [117.556636, 37.713736]
          ]
        ]]
      }
    }
  ]
};

// 默认导出
export default qingyunMapData;

// 工具函数：获取区域中心点
export const getRegionCenter = (): [number, number] => {
  return qingyunMapData.features[0].properties.center;
};

// 工具函数：获取区域名称
export const getRegionName = (): string => {
  return qingyunMapData.features[0].properties.name;
};

// 工具函数：获取行政区划代码
export const getAdcode = (): number => {
  return qingyunMapData.features[0].properties.adcode;
};